package JAVATest;

import java.util.Random;

/**
 * ClassName:Text_006
 * Package:JAVATest
 * Description:
 *
 * @Author:ZhangXin
 * @Create2023/1/10-23:49
 * @Version:v1.0
 */
public class Text_006 {


    public static void main(String[] args) {
        int count = 0;
        int sum = 0;
        int []arr = new int[10];
        Random r = new Random();
        for (int i = 0; i < arr.length; i++) {
            int number = r.nextInt(100)+1;
            arr[i]=number;
            System.out.print(arr[i]+" ");
            sum+=arr[i];
        }
        System.out.println();
        System.out.println("sum="+sum);
        double avg = (double)sum/arr.length;
        System.out.println("avg="+avg);
        for (int i = 0; i < arr.length; i++) {
            if(arr[i]<avg){
                count++;
            }
        }
        System.out.println("一共有count="+count+"个数小于平均数");
    }

}
